package com.reform.service;

import com.reform.pojo.teacher.Teacher;
import com.baomidou.mybatisplus.extension.service.IService;
import com.reform.res.Result;

import javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;

/**
 * <p>
 * 教师表 服务类
 * </p>
 *
 * @author mortale
 * @since 2021-06-26
 */
public interface ITeacherService extends IService<Teacher> {

    /**
     * 登录
     * @param gh
     * @param password
     * @param type
     * @return
     */
    Result login(String gh, String password, Integer type);

    /**
     * 初始化教师信息
     * @param teacher
     * @return
     */
    Result init(Teacher teacher) throws SQLException;

    /**
     * 获取当前用户信息
     * @param request
     * @return
     */
    Result getDefaultTeacherInfo(HttpServletRequest request) throws SQLException;

    /**
     * 修改用户邮箱
     * @param request
     * @return
     */
    Result changeEmail(String email,String password,String code,HttpServletRequest request);

    /**
     * 修改用户密码
     * @param request
     * @return
     */
    Result changePassword(String password,String newPassword,HttpServletRequest request);

    /**
     * 获取用户本地信息
     * @param request
     * @return
     */
    Result getDefaultLocalTeacherInfo(HttpServletRequest request);

    /**
     * 用户找回密码
     * @return
     * @param gh
     * @param password
     */
    Result findPassword(String gh,String email, String password);

    /**
     * 重置教师工号
     * @param gh
     * @return
     */
    Result resetTeacher(String gh);

    /**
     * 获取全校教师数据
     * @return
     */
    Result getAllTeacherInfo() throws SQLException;

    /**
     * 根据工号获取教师名
     * @param gh
     * @return
     */
    String getTeacherNameByGh(String gh) throws SQLException;

    /**
     * 根据工号获取教师所在部门
     * @param gh 教师工号
     * @return
     */
    String getTeacherDepByGh(String gh) throws SQLException;

    /**
     * 验证是否管理员
     *
     * @param gh
     * @param type
     * @return
     */
    boolean verifyAdminAuth(String gh, Integer type);

    /**
     * 验证是否专家
     *
     * @param gh
     * @param type
     * @return
     */
    boolean verifyExpertAuth(String gh, Integer type);

    /**
     * 根据教师工号获取身份类型
     * @param gh
     * @return
     */
    Result getTeacherTypeByGH(String gh);

    /**
     * 获取教师待办事项
     * @param request
     * @return
     */
    Result getTeacherDealt(HttpServletRequest request) throws SQLException;

    /**
     * 切换身份
     * @param request
     * @return
     */
    Result changeIdentity(HttpServletRequest request, Integer type);

    Result initAll() throws SQLException;
}
